package com.heaven.core.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.List;

/**
 * 视频三级分类(最多三级)
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document("video_category")
public class VideoCategoryEntity implements Serializable {
    /**分类id*/
    @Id
    private String catId;

    /**分类名称*/
    private String name;

    /**层级: 1、2、3*/
    private Integer catLevel;

    /**是否显示[0-不显示，1显示]*/
    private Integer showStatus;

    /**排序*/
    private Integer sort;

    /**图标地址*/
    private String icon;

    /**所属视频数量*/
    private Long videoCount;

    private List<VideoCategoryEntity> children;

    public VideoCategoryEntity(String catId ,String name, Integer catLevel, Integer showStatus, Integer sort, String icon, Long videoCount) {
        this.catId = catId;
        this.name = name;
        this.catLevel = catLevel;
        this.showStatus = showStatus;
        this.sort = sort;
        this.icon = icon;
        this.videoCount = videoCount;
    }

    public VideoCategoryEntity(String name, Integer catLevel, Integer showStatus, Integer sort, String icon, Long videoCount, List<VideoCategoryEntity> children) {
        this.name = name;
        this.catLevel = catLevel;
        this.showStatus = showStatus;
        this.sort = sort;
        this.icon = icon;
        this.videoCount = videoCount;
        this.children = children;
    }
}
